This is a search engine friendly export of a TiddlyWiki. Please click here for the actual site.

Myth Box Configuration


This is mostly for my reference, but you never know what might come in handy for someone else. I'm writing most of this after the fact, so I may have forgotten some steps, but I think this covers the main ones.

Pretty much all of the following needs to be run as root.
* {{{dnf install http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm}}}
* {{{dnf install mythtv}}}
* {{{dnf install ntp}}}
* Set /etc/ntp.conf server to Torch
* {{{systemctl start ntpd; systemctl enable ntpd}}}
* {{{systemctl start httpd; systemctl enable httpd}}}
* {{{dnf groupinstall "Xfce Desktop"}}}
* {{{dnf install kdm}}}
* Hopefully the above is enough to get a graphical environment going. Set it to boot to the UI by default:
* {{{systemctl set-default graphical}}}
* I had to hard link /etc/mythtv/config.xml to ~/.mythtv/config.xml for the backend to start.
* Configure sane video settings in Grub. Get the name of the output:
* {{{for p in /sys/class/drm/*/status; do con=${p%/status}; echo -n "${con#*/card?-}: "; cat $p; done}}}
* In {{{/etc/default/grub}}} (I'm not sure the vga line does anything with KMS, but it won't hurt either):
* {{{GRUB_CMDLINE_LINUX="rhgb quiet vga=0x3d9 splash video=HDMI-A-1:1920x1080"}}}
* {{{grub2-mkconfig -o /boot/grub2/grub.cfg}}}
* fstrim cron job. In {{{/etc/cron.daily/fstrim}}}:
{{{
#!/bin/bash
fstrim -a
}}}
* {{{chmod +x /etc/cron.daily/fstrim}}}
* Configure mythweb in {{{/etc/httpd/conf.d/mythweb.conf}}}. Specifically the database and possibly hostname.
* {{{max_input_vars = 10000}}} in /etc/php.ini (allows editing of large channel lists via MythWeb)
* Apply ugly hack if X keeps losing the plot when you turn the tv off. Create the following file in /usr/local/sbin/uglyhack:
{{{
#!/bin/bash

export DISPLAY=:0
while :
do
if ! xrandr --nograb --current | grep -q \*
then
xrandr --output HDMI-0 --mode 1920x1080
fi
sleep 1
done
}}}
* {{{chmod +x /usr/local/sbin/uglyhack}}}
* Then create a systemd service to run it (probably in /etc/systemd/system):
{{{
[Unit]
Description=Ugly X Hack
After=graphical.target

[Service]
Type=simple
User=cybertron
ExecStart=/usr/local/sbin/uglyhack
Restart=always

[Install]
WantedBy=graphical.target
}}}
* {{{systemctl start uglyhack; systemctl enable uglyhack}}}
* The default mythbackend unit file needs some tweaks or myth doesn't start right at boot time. Put the following in /etc/systemd/system/mythbackend.service:
{{{
[Unit]
Description=MythTV backend service
After=network-online.target mariadb.service mysqld.service time-sync.target
Wants=httpd.service

[Service]
Type=simple
Environment=MYTHCONFDIR=/etc/mythtv
User=mythtv
ExecStart=/usr/bin/mythbackend --logpath /var/log/mythtv
Restart=always
Restart=on-failure
StartLimitBurst=5
StartLimitInterval=1

[Install]
WantedBy=multi-user.target
}}}